package com.naizhuai.ui.entity.mainbusiness;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * 主页展示的基本的问题类型
 * Created by code_han on 2018/4/26.
 */

public class ActionShowMainItemBean implements Serializable {
    //预备状态
    public static final String ACTION_STATUS_PREPARE = "PREPARE";
    //准备状态
    public static final String ACTION_STATUS_READY = "READY";
    //进行状态
    public static final String ACTION_STATUS_DOING = "DOING";
    //待审核状态
    public static final String ACTION_STATUS_VERIFY = "VERIFY";
    //结束状态
    public static final String ACTION_STATUS_COMPLETE = "COMPLETE";

    //步骤一
    public static final String STEP_1 = "1";
    //步骤二
    public static final String STEP_2 = "2";
    //步骤三
    public static final String STEP_3 = "3";
    //步骤四
    public static final String STEP_4 = "4";

    //问题类型（普通类型）
    public static final String ACTION_TYPE_NORMAL = "N";
    //问题类型（示范问题）
    public static final String ACTION_TYPE_EXAM = "R";


    private String questionId;
    //问题名称
    private String questionTitle;
    //问题展示图片
    @SerializedName("questionImage")
    private String questionImageUrl;
    //问题状态
    private String questionStatus;
    //问题提出时间
    private String questionStartTime;
    //问题结束时间
    private String questionEndTime;
    //问题创建人的基本信息
    private ActionUserInfo createUserInfo;
    //问题状态的中文名称
    private String questionStatusName;
    //问题类型
    private String questionType;
    //问题类型对应的中文名称
    private String questionTypeName;
    //问题解决的步骤//一共四个
    private String step;

    public ActionShowMainItemBean() {
    }

    public String getStep() {
        return step;
    }

    public void setStep(String step) {
        this.step = step;
    }

    public String getQuestionId() {
        return questionId;
    }

    public void setQuestionId(String questionId) {
        this.questionId = questionId;
    }

    public String getQuestionTitle() {
        return questionTitle;
    }

    public void setQuestionTitle(String questionTitle) {
        this.questionTitle = questionTitle;
    }

    public String getQuestionStatus() {
        return questionStatus;
    }

    public void setQuestionStatus(String questionStatus) {
        this.questionStatus = questionStatus;
    }

    public String getQuestionStartTime() {
        return questionStartTime;
    }

    public void setQuestionStartTime(String questionStartTime) {
        this.questionStartTime = questionStartTime;
    }

    public String getQuestionEndTime() {
        return questionEndTime;
    }

    public void setQuestionEndTime(String questionEndTime) {
        this.questionEndTime = questionEndTime;
    }

    public ActionUserInfo getCreateUserInfo() {
        return createUserInfo;
    }

    public void setCreateUserInfo(ActionUserInfo createUserInfo) {
        this.createUserInfo = createUserInfo;
    }

    public String getQuestionStatusName() {
        return questionStatusName;
    }

    public void setQuestionStatusName(String questionStatusName) {
        this.questionStatusName = questionStatusName;
    }

    public String getQuestionType() {
        return questionType;
    }

    public void setQuestionType(String questionType) {
        this.questionType = questionType;
    }

    public String getQuestionTypeName() {
        return questionTypeName;
    }

    public void setQuestionTypeName(String questionTypeName) {
        this.questionTypeName = questionTypeName;
    }

    public String getQuestionImageUrl() {
        return questionImageUrl;
    }

    public void setQuestionImageUrl(String questionImageUrl) {
        this.questionImageUrl = questionImageUrl;
    }

    public static class ActionUserInfo implements Serializable{
        private String uid;
        private String name;
        private String thumb;

        public ActionUserInfo() {
        }

        public String getUid() {
            return uid;
        }

        public void setUid(String uid) {
            this.uid = uid;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getThumb() {
            return thumb;
        }

        public void setThumb(String thumb) {
            this.thumb = thumb;
        }
    }

    public static float getProcessStatus(String type) {
        switch (type) {
            case ACTION_STATUS_PREPARE:
                return 0.2f;
            case ACTION_STATUS_READY:
                return 0.4f;
            case ACTION_STATUS_DOING:
                return 0.6f;
            case ACTION_STATUS_VERIFY:
                return 0.8f;
            case ACTION_STATUS_COMPLETE:
                return 1.0f;
        }
        return 0;
    }

    public static float getProcess(String type) {
        switch (type) {
            case STEP_1:
                return 0.25f;
            case STEP_2:
                return 0.50f;
            case STEP_3:
                return 0.75f;
            case STEP_4:
                return 1f;
        }
        return 0;
    }

}
